Release 10.1A: OpenEdge Data Management:
DataServer for ODBC
Running a stored procedure
The Progress 4GL statement
RUNSTORED–PROCallows you to run a stored procedure in the ODBC data source. You must also indicate the end of a stored procedure in your Progress procedure by using theCLOSESTORED–PROCstatement.This is the syntax for the
RUNSTORED–PROCstatement:
This is the partial syntax for the
CLOSESTORED–PROCstatement:
For example, the following Progress 4GL code runs the stored procedure
pcust:
This code first defines an integer variable named
handle1that serves as a handle for identifying the stored procedure. If you have only one active stored procedure, you do not have to specify a handle. However, it is good programming practice to use handles to identify all of your stored procedures.It then runs the stored procedure as follows:
The Progress procedure next uses the
CLOSESTORED–PROCstatement to fetch the orders and states output parameters and then displays them. Note that the stored procedure does not return output parameter values unless you request them with the keywordOUTPUTorINPUT–OUTPUTwhen you execute the procedure.You can close all stored procedures at once with the following statement:
Note: For Sybase, the DataServer typically maintains one connection. If your application requires that you process other queries while a stored procedure is open, use the
-Dsrvqt_separate_connectionparameter or theQUERY–TUNING (SEPARATE–CONNECTION)option to specify that the DataServer use a separate connection for each statement that requires a cursor.See Appendix B, "Stored Procedure Reference," for a description of the complete syntax for the Progress statements and functions that support running stored procedures.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |